#include <avr/io.h>
#include "ACUAS/ACUAS.h"
#include "ACUAS/ACUASlcd.h" //Header file included


PROGRAM_INIT

ACTIVATE_ADC
ACTIVATE_LCD
float x;
float xdisplay;
float y, ydisplay;

PROGRAM_START

ADC_CHANNEL(1)
ADCONVERT_MV(x)


if(x>=810)
	{
		xdisplay= 0.157*(x-810);
	}
else if (x<810)
	{
		xdisplay= -1*(90 + 0.176*(300-x));
	}


LCD_XY(1,1)
LCD_TEXT(" X Axis ")
LCD_NUMBER(xdisplay)
LCD_TEXT(" deg ")
LCD_TEXT("      ")


ADC_CHANNEL(2)
ADCONVERT_MV(y)

if(y>=839)
	{
		ydisplay= -1*(0.166*(y-839));
	}
else if (y<839)
	{
		ydisplay= (90 + 0.166*(300-y));
	}

LCD_XY(1,2)
LCD_TEXT(" Y Axis ")
LCD_NUMBER(ydisplay)
LCD_TEXT(" deg ")
LCD_TEXT("      ")


PROGRAM_END
